package com.complex.spring.advance.service.impl;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

import com.complex.spring.advance.service.ITestB;
import com.complex.spring.advance.service.ITestC;

public class XmlBeanReader {
	public static void main(String[] args) {
		
		//使用XML配置的spring文件读取
		BeanFactory xmlbean = new XmlBeanFactory(new ClassPathResource(
				"/bean/spring-service.xml"));
		System.out.println("bean testB start======>");
		ITestB testB = (ITestB) xmlbean.getBean("testB");
		testB.print();
		
		System.out.println("bean testC start======>");
		ITestC testC = (ITestC) xmlbean.getBean("testC");
		testC.print();
		
	}
}
